$(function() {
	//会员报价
	$("#now_bj0").click(function() {
		var vehicle_id = $("#vehicle_id").val();
		var sum = '';
		var id_list = '';
		 $(".bj0").each(function(index,element){
			 sum += $(this).val()+":";
		});
		 $(".list_0").each(function(index,element){
			 if($(this).val()) {
				 id_list += $(this).val()+",";
			 }
		});
		 if(!id_list) {
			 alert("请选择需要的险种");
			 return false;
		 }
		var json_data = {vehicle_id:vehicle_id,sum:sum,id_list:id_list};
		ajax_post("/wap/user/user_offer",json_data,function(data) {
			if(data.status)
			alert(data.msg);
			window.location.href = data.refer;
		}); 
	});
	//会员报价
	$("#now_bj1").click(function() {
		var vehicle_id = $("#vehicle_id").val();
		var sum = '';
		var id_list = '';
		 $(".bj1").each(function(index,element){
			 sum += $(this).val()+":";
		});
		 $(".list_1").each(function(index,element){
			 if($(this).val()) {
				 id_list += $(this).val()+",";
			 }
		});
		 if(!id_list) {
			 alert("请选择需要的险种");
			 return false;
		 }
		var json_data = {vehicle_id:vehicle_id,sum:sum,id_list:id_list};
		ajax_post("/wap/user/user_offer",json_data,function(data) {
			if(data.status)
			alert(data.msg);
			window.location.href = data.refer;
		}); 
	});
	//会员报价
	$("#now_bj2").click(function() {
		var vehicle_id = $("#vehicle_id").val();
		var sum = '';
		var id_list = '';
		 $(".bj2").each(function(index,element){
			 sum += $(this).val()+":";
		});
		 $(".list_2").each(function(index,element){
			 if($(this).val()) {
				 id_list += $(this).val()+",";
			 }
		});
		 if(!id_list) {
			 alert("请选择需要的险种");
			 return false;
		 }
		var json_data = {vehicle_id:vehicle_id,sum:sum,id_list:id_list};
		ajax_post("/wap/user/user_offer",json_data,function(data) {
			if(data.status)
			alert(data.msg);
			window.location.href = data.refer;
		}); 
	});		
});
